import Vue from "vue"
import Router from "vue-router"
import Index from "./views/index.vue"
import List from "./views/list.vue"
import Detail from "./views/detail.vue"





//使用路由
Vue.use(Router);

export  default new Router({
    mode: "history",            //两个值  history hash(路径会有#)
    base: process.env.BASE_URL,   //内置的变量
    routes:[
        {
            path: "*",          //访问
            redirect: "/index"   //重定向
        },
        {
            path: "",          //访问
            redirect: "/index"   //重定向
        },
        {
            path: "/index",         //路径
            component:Index        //组件
        },
        {
            path: "/list",
            component: List
        }, {
            path: "/detail",
            component: Detail
        }
    ]
})